home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_pyr_scorpions.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  108 lines

  1. # Jones 3D Cog Script
  2. #
  3. # pyr_scorpions
  4. #
  5. # generate scorpions as Indy runs around the level
  6. #
  7. # [RKD] [GGJ]
  8. #
  9. # (C) 1998 LucasArts Entertainment Co. All Rights Reserved
  10. # ========================================================================================
  11. symbols
  12. message    startup
  13. message timer
  14. message    killed
  15.  
  16. thing    generator0    nolink
  17. thing    generator1    nolink
  18. thing    generator2    nolink
  19. thing    generator3    nolink
  20. thing    generator4    nolink
  21. thing    generator5    nolink
  22. thing    generator6    nolink
  23. thing    generator7    nolink
  24. thing    generator8    nolink
  25. thing    generator9    nolink
  26. thing    generator10    nolink
  27. thing    generator11    nolink
  28. thing    generator12    nolink
  29. thing    generator13    nolink
  30. thing    generator14    nolink
  31. thing    generator15    nolink
  32.  
  33. thing    scorpion1    local
  34. thing    scorpion2    local
  35.  
  36. template    bug=scorpian    local
  37.  
  38. int        curtimer=5    local
  39. int        gennum=-1    local
  40.  
  41. # subroutine
  42. flex    makescorps=0    local
  43. end
  44. # ........................................................................................
  45. code
  46. startup:
  47.     sleep(.01);
  48.  
  49.     # hold off scorpion creation until opening has a chance to speed up
  50.     SetTimer(20);
  51.  
  52.     scorpion1 = -1;
  53.     scorpion2 = -1;
  54.  
  55.     return;
  56.     
  57. timer:
  58.     gennum = RandBetween(0, 15);
  59.     
  60.     # if indy is underground, make scorpions automatically
  61.     if (global11 == 1)
  62.     {
  63.         call makescorps;
  64.     }
  65.     else
  66.     {
  67.         # if indy is above ground, check to see if Indy is far enough away
  68.         if (VectorDist(GetThingPos(GetLocalPlayerThing()), GetThingPos(generator0[gennum])) > .5) #&& (IsGhostVisible)
  69.         {
  70.             call makescorps;
  71.         }
  72.     }
  73.  
  74.     SetTimer(curtimer);
  75.     return;
  76.  
  77. makescorps:
  78.     # make a scorpion, depending on which previous ones, if any, are dead
  79.     if (scorpion1 == -1)
  80.     {
  81.         scorpion1 = CreateThing(bug, generator0[gennum]);
  82.         CaptureThing(scorpion1);
  83.     }
  84.     else if (scorpion2 == -1)
  85.     {
  86.         scorpion2 = CreateThing(bug, generator0[gennum]);
  87.         CaptureThing(scorpion2);
  88.     }
  89.     
  90.     return;
  91.     
  92. killed:
  93. # ---> scorpions    
  94.     if (GetSenderRef() == scorpion1)
  95.     {
  96.         scorpion1 = -1;
  97.     }
  98.     else
  99.     {
  100.         scorpion2 = -1;
  101.     }
  102.  
  103.     # delay creation a little more every time Indy kills a scorpion
  104.     curtimer = curtimer + 5;
  105.     
  106.     return;
  107. end
  108.